package book;

/**
 * Created with IntelliJ IDEA.
 * Description:书架
 * User: lenovo
 * Date: 2024-06-04
 * Time: 20:29
 */
public class BookList {
    private Book[] booklist = new Book[10];//用来存放书
    private int usedSize;//计数器，用来记录当前书架有多少书

    public BookList() {
        booklist[0] = new Book("三国演义","罗贯中",71,"小说");
        booklist[1] = new Book("西游记","吴承恩",82,"小说");
        booklist[2] = new Book("红楼梦","曹雪芹",79,"小说");
        this.usedSize = 3;
    }

    public void setBooks(int pos, Book book){
        booklist[pos] = book;
    }
    public Book getBook(int pos){
        return booklist[pos];
    }
    public int getUsedSize() {
        return usedSize;
    }

    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }
}
